<?php
class UserBookCondition extends Zend_Db_Table_Abstract {
	
	protected $_primary = "id";
	protected $_name = "user_book_condition";
	
	
	/**
	 * Find condition by id.
	 * 
	 * @param $id
	 */
	public function findById($id) {
		return $this->find($id)->current();
	}
	
    /**
     * Get condition string from given ids.
     * 
     * @param $idStr
     */
    public static function getConditionStrings($idStr) {
        $idArr = explode(",", $idStr);
        $ret = array();
        $index = 0;
        $object = new UserBookCondition();
        foreach ($idArr as $id) {
            $obj = $object->findById($id);
            $ret[$index++] = $obj->condition;
        }
        return $ret;
    }
}
?>